package com.anydata.android.weatherforecast.weather;

/** Useful Utility in working with temperatures. (conversions). */
public class WeatherUtils {

	public static String fahrenheitToCelsius(String strFahrenheit) {
		if(strFahrenheit.equalsIgnoreCase("") ){
			return null;
		}
        
		int tFahrenheit = Integer.valueOf(strFahrenheit);
		int tCelsius = (int) ((5.0f / 9.0f) * (tFahrenheit - 32));
		
		return Integer.valueOf(tCelsius).toString();
	}

	public static String celsiusToFahrenheit(String strCelsius) {
		
		if(strCelsius == ""){
			return null;
		}
		
		int tCelsius = Integer.valueOf(strCelsius);
		int tFahrenheit = (int) ((9.0f / 5.0f) * tCelsius + 32);

		return Integer.valueOf(tFahrenheit).toString();
	}
}
